package ${packageName}.service;

import ${packageName}.pojo.${modelName};

import org.springframework.web.multipart.MultipartFile;
import ${packageName}.result.Pager;
import ${packageName}.result.Result;
import java.util.List;


public interface ${serviceName}{
/**
*增加${remarksTable}数据
**/
int insert${modelName}(${modelName} record)throws Exception;

<#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
    /**
    *删除${remarksTable}数据
    **/
    int delete${modelName}ByPrimaryKey(<#list primaryKeyColumns as column><#if column_index != 0> , </#if> ${column.javaType} ${column.propertyName?uncap_first} </#list>)throws Exception;
</#if>

<#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
    /**
    * 通过主键删除多条${remarksTable}数据
    **/
    int delete${modelName}ByIds(<#list primaryKeyColumns as column><#if column_index != 0> , </#if> String [] ${column.propertyName?uncap_first}s</#list>)throws Exception;
</#if>


<#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
    /**
    * 更新${remarksTable}数据
    **/
    int update${modelName}ByPrimaryKey(${modelName} record)throws Exception;
</#if>
<#if primaryKeyColumns ?has_content  &&  (primaryKeyColumns?size > 0 && primaryKeyColumns?size == 1)>
    /**
    * 批量更新属性不为空${remarksTable}数据
    **/
    <#list primaryKeyColumns as column>
        int update${modelName}ByPrimaryKeyNotNull(${modelName} record,String[] ${column.propertyName?uncap_first}s) throws Exception;
    </#list>
</#if>

<#if primaryKeyColumns ?has_content  && (primaryKeyColumns?size > 0)>
    /**
    * 通过主键查询${remarksTable}数据
    **/
    ${modelName} select${modelName}ByPrimaryKey(<#list primaryKeyColumns as column><#if column_index != 0> , </#if> ${column.javaType} ${column.propertyName?uncap_first} </#list>);
</#if>


/**
* 通过条件查询${remarksTable}数据
**/
List<${modelName}> select${modelName}(${modelName} ${modelName?uncap_first}  , String desc, String startTime, String endTime, String notNullAttributes,
String isNullAttributes, String globalSearch,String likeNameSearch, Double amountSearch,
String universalTime,String multipleChoiceCondition, String fieldConditionStr);

/**
*总条数
**/
long get${modelName}PageCount(${modelName} ${modelName?uncap_first}, String desc, String startTime, String endTime, String notNullAttributes,
String isNullAttributes, String globalSearch,String likeNameSearch, Double amountSearch, String universalTime,String multipleChoiceCondition, String fieldConditionStr);
/**
* 分页条件查询${remarksTable}
**/
Pager<${modelName}> get${modelName}Page(long curPage, int pageSize, String orderBy, ${modelName} ${modelName?uncap_first}, String desc, String startTime, String endTime, String notNullAttributes,
String isNullAttributes, String globalSearch,String likeNameSearch, Double amountSearch, String universalTime,String multipleChoiceCondition, String fieldConditionStr,String isLimit);
/**
* 导出${remarksTable}模板
*
* @throws Exception
*/
void exportSpSupplierTemplate() throws Exception;


/**
* 导出${remarksTable}
* @param orderBy 以什么排序
* @param ${modelName?uncap_first}
* @param desc 是否降序排序
* @param startTime 开始时间
* @param endTime 结束时间
* @param notNullAttributes 不为空筛选  多个,分割
* @param isNullAttributes 为空筛选 多个
* @param globalSearch
* @param likeNameSearch 模糊查询 格式 {字段:'条件'}
* @param amountSearch 数值模糊查询
* @param universalTime 时间 格式 {字段:{startTime:'',endTime:''}}
* @param multipleChoiceCondition 多选条件格式 {字段:[数据,数据]}
* @param fieldConditionStr 高级查询json 格式[{databaseId:'',relationId:'',datas:[]}]
* @throws Exception
*/

 void exportSpSupplier(String orderBy, ${modelName} ${modelName?uncap_first}, String desc, String startTime, String endTime, String notNullAttributes, String isNullAttributes, String globalSearch, String likeNameSearch, Double amountSearch, String universalTime, String multipleChoiceCondition, String fieldConditionStr) throws Exception ;

/**
* 导入${remarksTable}数据
*
* @param file
* @throws Exception
*/

 void import${modelName}(MultipartFile file) throws Exception;
}